Visual Basic (Declaration) | |
---|---|
Public Overloads Function Run( _ ByVal ParamArray args() As String _ ) As Integer |
Parameters
- args
Library/Library.Test/TestScriptRunner.cs
C# | Copy Code |
---|---|
using (ScriptRunner runner = new ScriptRunner(ScriptEngine.Language.Exe, @"cmd.exe")) { StringWriter sw = new StringWriter(); runner.OutputReceived += delegate(object o, ProcessOutputEventArgs e) { sw.WriteLine(e.Data); }; Assert.AreEqual(0, runner.Run("/c", "@echo From EXE")); Assert.AreEqual("From EXE", sw.ToString().Trim()); } |
VB.NET | Copy Code |
---|---|
Using runner As New ScriptRunner(ScriptEngine.Language.Exe, "cmd.exe") Dim sw As New StringWriter() runner.OutputReceived += Function(o As Object, e As ProcessOutputEventArgs) Do sw.WriteLine(e.Data) End Function Assert.AreEqual(0, runner.Run("/c", "@echo From EXE")) Assert.AreEqual("From EXE", sw.ToString().Trim()) End Using |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
ScriptRunner ClassScriptRunner Members
Overload List